import dash
from dash import html, dcc
import plotly.express as px
import pandas as pd

app = dash.Dash(__name__)

# 数据源
df = pd.DataFrame(
    {
        "x": [1, 2, 3, 4, 5],
        "y": [10, 12, 14, 16, 18],
    }
)

# plotly express绘制折线图
fig = px.line(df, x="x", y="y", title="折线图")

# webui界面
app.layout = html.Div([
    dcc.Graph(figure=fig)
])

if __name__ == "__main__":
    app.run(debug=True, port=8090)
